package com.kate.mall.order.price.group;

import com.kate.mall.order.dto.GrouponRulesDTO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/11/5 11:37
 */
@Component
public class GrouponCalculatorFactory {
    @Resource
    private  DefaultGrouponPriceCalculator defaultGrouponPriceCalculator;
    /**
     * 创建一个团购计算组件
     * @param grouponRulesDTO 团购
     * @return 团购计算组件
     */
    public GrouponPriceCalculator create(GrouponRulesDTO grouponRulesDTO) {
        if(grouponRulesDTO!=null) {
            return defaultGrouponPriceCalculator;
        }
        return null;
    }
}
